<script setup>
import { onMounted } from 'vue'
import {useUserStore} from '/src/stores/user/index'

const useUser = useUserStore()

/**
 * 进来加载数据
 */
onMounted(() => {
  // 校验用户是否已经登录
  let isLogin = localStorage.getItem('isLogin')
  if (isLogin) {
    let userInfoStr = localStorage.getItem('userInfo')
    useUser.updateUserInfo(JSON.parse(userInfoStr))
  }
})
</script>

<template>
  <div>
    <router-view></router-view>
  </div>
</template>
<style scoped lang='less'>
</style>


